/*******************************************************************************
 * Copyright (c) 2014 lifeng (lifengsofts@gmail.com)
 * See the file licenses/license.txt for copying permission.
 ******************************************************************************/
package cn.woblog.android.httputils.callback;

import java.io.OutputStream;
import java.net.HttpURLConnection;

import org.apache.http.HttpResponse;

import cn.woblog.android.httputils.exception.AppException;

public interface ICallback<T> {
	void onSuccess(T result);

	void onCanceled();

	void onFailure(AppException exception);

	T handle(HttpResponse response) throws AppException;

	void cancel();

	T preRequest();

	T postRequest(T result);

	boolean onCustomParams(OutputStream out);

	T handle(HttpURLConnection connection) throws AppException;
}
